package com.sxj.corejava.entity;

import com.sxj.corejava.code18_工厂模式.ObjectFactory;

public class User {

    private Integer id;
    private String username;
    private String password;
    // 在当前类中使用工厂获取其他由工厂配置的对象的时候,其加载的时机必须比当前类要更早
    // 否则在加载当前类的时候会读取不到该属性的配置,导致报错
    private Address address = (Address) ObjectFactory.getObject("address");

//    private Date date = (Date) ObjectFactory.getObject("date");

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
